import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout'
import Article from '../views/Article'
import Collect from '../views/Collect'
import Video from '../views/Video'
import User from '../views/User'
import ArticleDetail from '../views/ArticleDetail'
import Login from '../views/Login'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Layout,
      children: [
        { path: 'article', component: Article },
        { path: 'collect', component: Collect },
        { path: 'video', component: Video },
        { path: 'user', component: User }
      ]
    },
    { path: '/detail/:id', component: ArticleDetail },
    { path: '/login', component: Login }
    // { name: 'collect', path: '/collect/:words?', component: Collect },
  ]
})

export default router
